1 /* JJT: 0.2.2 */ 2 3 package mobisnap.mobile_trx; 4 5 public class ASTBeginEndBlock extends mobisnap.mobile_trx.SimpleNode { 6 ASTSequenceOfStatements stats; 7 ASTExceptionBlock exception; 8 ASTOnCommitBlock commit; 9 ASTOnRollbackBlock rollback; 10 boolean mainblock = false; 11 12 public ASTBeginEndBlock(int id) { 13 super(id); 14 } 15 16 public ASTBeginEndBlock( MobisnapSQL p, int i) { 17 super( p, i); 18 id = i; 19 } 20 21 /*** Accept the visitor. **/ 22 public Object jjtAccept(MobisnapSQLVisitor visitor, Object data) { 23 return visitor.visit(this, data); 24 } 25 26 public void process( int msql_type) throws Exception { 27 try { 28 stats.process( msql_type); 29 MobisnapSQL.transaction.commit(); 30 if( mainblock) 31 throw new CommitException( "Code reach end of main block"); 32 } catch( CommitException e) { 33 if( commit != null) { 34 commit.process( msql_type); 35 MobisnapSQL.transaction.commit(); 36 } 37 throw e; 38 } catch( RollbackException e) { 39 if( rollback != null) { 40 rollback.process( msql_type); 41 MobisnapSQL.transaction.commit(); 42 } 43 throw e; 44 } 45 } 46 47 }

This page was automatically generated by Maven